'use strict';

const Controller = require('egg').Controller;

const test = require('../../class/test');
console.log(new test == new test);

class HomeController extends Controller {
  //page
  async home() {
    const ctx = this.ctx;
    const app = this.app;
    
    ctx.locals = {
      page_title: "管理后台",
      site: app.config.site,
      bodyClass: 'fixed-sidebar full-height-layout',
    }
    await ctx.render('admin/home.html');
  }

  /**
   * @description 首页
   * @author xiezuobing[948466]<435321508@qq.com>
   * @memberof HomeController
   */
  async index() {
    const ctx = this.ctx;
    const visitCount = await this.service.visitLog.count();
    const article = await this.service.article.queryListPre();
    ctx.locals = {
      visitCount:visitCount,
      article: article,
    }
    await ctx.render('admin/index.html');
  }
  //json
  
}

module.exports = HomeController;